﻿Ext.extend(NExt.form.CheckboxGroup, Ext.form.CheckboxGroup, {
    getModel: function() {
        var model = {};
        this.eachItem(function(checkBox) {
            var value = checkBox.getModel();
            var key = checkBox.dataMember;
            model[key] = value;
        });

        return model;
    },

    setModel: function(model) {
        this.eachItem(function(checkBox) {
            var key = checkBox.dataMember;
            var value = model[key];
            if (Ext.isDefined(value)) {
                checkBox.setModel(value);
            }
        });
    }

});